package com.xinghanlaser.applet.base.auth.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.xinghanlaser.applet.base.auth.entity.ResourceDO;
import com.xinghanlaser.applet.base.auth.query.ResourceQuery;
import com.xinghanlaser.applet.base.auth.vo.ResourcePostVO;
import com.xinghanlaser.applet.base.auth.vo.ResourcePutVO;
import com.xinghanlaser.applet.base.auth.vo.ResourceTreeVO;
import com.xinghanlaser.applet.base.auth.vo.ResourceVO;
import com.xinghanlaser.applet.base.common.entity.ResponseEntity;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 资源表（菜单、按钮、接口） 服务类
 * </p>
 *
 * @author dym
 * @since 2019-11-19
 */
public interface IResourceService extends IService<ResourceDO> {
    /**
     * 根据传入的ids筛选出数据库存在的id列表
     * @param ids
     * @return
     */
    Set<Long> getExistResourceList(Collection<Long> ids);

    ResponseEntity<ResponseEntity.PageResult<ResourceTreeVO>> pageByCondition(ResourceQuery query);

    List<ResourceTreeVO> tree(Long pid);

    ResponseEntity<Set<ResourceVO>> getResourceListByRoleId(Long id);

    ResponseEntity<Void> removeResource(Long id);

    ResponseEntity<Void> addResource(ResourcePostVO postVO);

    ResponseEntity<Void> modResource(ResourcePutVO putVO);
}
